package com.leo.foodmaster.admin.system.service.impl;

import com.leo.foodmaster.admin.system.entity.UserRole;
import com.leo.foodmaster.admin.system.mapper.UserRoleMapper;
import com.leo.foodmaster.admin.system.service.IUserRoleService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 * 用户和角色关联表 服务实现类
 * </p>
 *
 * @author Leo
 * @since 2021-06-18
 */
@Service
public class UserRoleServiceImpl extends ServiceImpl<UserRoleMapper, UserRole> implements IUserRoleService {

    /**
     * 根据用户Id查询角色Ids
     * @param userId 用户Id
     * @return List<Long>
     */
    @Override
    public List<Long> getRoleIdsByUserId(Long userId) {
        return baseMapper.getRoleIdsByUserId(userId);
    }
}
